I have a string which contains filter query i want to create filter on that string. |
Re: Cast String To Filter
When your filter string is syntactically correct DXL code, a short solution is possible (although its a little magic):
bool setFilter (Module m, string filtStr) {
string code = "Module m = addr_ " ((addr_ m) int) "\ncurrent=m\nFilter f = " filtStr"\n; set f"
noError(); eval_ code; return (null lastError)
}
string strOK = "(attribute \"Object Text\" == \"Done\" || attribute \"Object Heading\" == \"Done2\")"
print setFilter (current Module, strOK )
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Cast String To Filter Mathias Mamsch - Mon Sep 06 08:22:51 EDT 2010
When your filter string is syntactically correct DXL code, a short solution is possible (although its a little magic):
bool setFilter (Module m, string filtStr) {
string code = "Module m = addr_ " ((addr_ m) int) "\ncurrent=m\nFilter f = " filtStr"\n; set f"
noError(); eval_ code; return (null lastError)
}
string strOK = "(attribute \"Object Text\" == \"Done\" || attribute \"Object Heading\" == \"Done2\")"
print setFilter (current Module, strOK )
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Thanks a lot.... Thanks & Regards, Hardik Shah |
Re: Cast String To Filter SystemAdmin - Mon Sep 06 10:18:00 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Cast String To Filter Thanks, Hardik Shah |
Re: Cast String To Filter Mathias Mamsch - Mon Sep 06 10:38:05 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Thanks for posting this thread. I appreciate that it is searchable from Google. I was able to use the code above to apply the modified filter that I had created as a string variable. |